#ifndef QTTEST_MESSAGE_H
#define QTTEST_MESSAGE_H

#include "./Handler.h"

class Message;

/*定义函数指针类型*/
typedef void (*MessageCallback)(const Message *);

class Message {
private:
    Message(int what, Handler *handler, MessageCallback callback)
            : what(what), handler(handler), callBack(callback) {

    }

    ~Message() = default;

public:
    int what;
    Handler *handler;
    MessageCallback callBack;

public:
//    static Message *obtain();

    static Message *obtain(int what, Handler *pHandler);

    static void recycle(Message *pMessage);

};


#endif //QTTEST_MESSAGE_H
